package com.green.model.manage.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public enum PositionEnum {

	SELLGU("网络营销顾问",1),
	CITYMANAGER("城市总经理",7),
	SELLZHU("销售运营助理",2),
	SELLZHUMANAGER("销售运营主管",3),
	DAQUMANAGER("大区总监",7),
	AREAMANAGER("区域经理",6),
	CHINACEO("中国区CEO",8),
	SELLMANAGER("销售总监",6),
	SENIORSELLGU("资深网络营销顾问",5);
	
	private PositionEnum(){}
	private PositionEnum(String name,int value){
		this.name = name;
		this.value = value;
	}
	private String name;
	private int value;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getValue() {
		return value;
	}
	public void setValue(int value) {
		this.value = value;
	}
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static List toList(){
		StateEnum[] ary = StateEnum.values();
		List bank = new ArrayList();
		for(int i=0;i<ary.length;i++){
			Map<String,String> map = new HashMap<String,String>();
			map.put("value", ary[i].toString());
			map.put("name", ary[i].getName());
			bank.add(map);
		}
		return bank;
	}
	public static PositionEnum initName(String name){
	    PositionEnum[] enums = PositionEnum.values();
	    PositionEnum result = null;
	    for(PositionEnum em:enums){
	        String n = em.getName();
	        if(n.equals(name)){
	            result= em;
	            break;
	        }
	    }
	    return result;
	}
}
